home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Timothy Knox / Pocket6.3 / Extensions / Starting / Chapter 12 / NoWeighting < prev   
Text File  |  1994-06-24  |  1KB  |  30 lines

  1. \ No Weighting demo from Starting Forth Chapter 12
  2. \ NOTE: If it says: ' STRING  ? ' below,
  3. \       load the file 'Brodie' first.
  4.  
  5. variable DENSITY  variable THETA  variable I.D.
  6. : ,"  ( -- )  here 34 string ;
  7. : .SUBSTANCE  i.d. @ count type space ;
  8. : MATERIAL  ( 'string density theta -- )  create , , ,
  9.     does>  dup @ theta !  2+ dup @ density !  2+ @ i.d. ! ;
  10.  
  11. : FOOT ( feet -- scaled-height ) 10 * ;
  12. : INCH ( scaled-height -- scaled-height' )
  13.     100 12 */  5 + 10 / + ;
  14.  
  15. : /TAN  ( n -- n' ) 1000 theta @ */ ;
  16. : PILE  ( scaled-height -- )
  17.     dup dup 10 */  1000 */  355 339 */  /tan /tan
  18.     density @  200 */  ." = "  .  ." tons of "  .substance ;
  19.  
  20. \ table of materials
  21. \ string-address    density    theta
  22. ," cement"            131       700   material CEMENT
  23. ," loose gravel"       93       649   material LOOSE-GRAVEL
  24. ," packed gravel"     100       700   material PACKED-GRAVEL
  25. ," dry sand"           90       754   material DRY-SAND
  26. ," wet sand"          118       900   material WET-SAND
  27. ," clay"              120       727   material CLAY
  28.  
  29. CEMENT
  30.